(define db (quote (
((content)(tags))
((here is an example of content) (example content))
((an entry is a list containing two lists. The first list is the content. The second list is tags) (explanation tags))
)))

(define get-content (lambda (entry) (car entry)))

(define get-tags (lambda (entry) (cadr entry)))

(define subset? (lambda (keys lat)
  (cond ((null? keys) #t)
        ((memq (car keys) lat) (subset? (cdr keys) lat))
        (#t #f))))

(define tag-query (lambda (tags db)
  (cond ((null? db) '())
        ((subset? tags (get-tags (car db))) (cons (car db) (tag-query tags (cdr db))))
        (#t (tag-query tags (cdr db))))))


